
var accessLevel = {
    100000000: "Tier1",
    100000001: "Tier2",
    100000002: "Tier3"
}

var relationshipType = {
    100000000: "Client",
    100000001: "FormerClient",
    100000002: "Demo",
    8: "Prospect"
}

var status = {
    "-1": "Unknown",    
    "0": "Active",
    "1": "Inactive"
}


var collection = db.getSiblingDB("ClientPlatform").Account
collection.find({Status: { $type: 16 }}).forEach(function(item){

    item.RelationshipType = relationshipType[item.RelationshipType];
    item.Status = status[item.Status];
    item.PlatformTier = accessLevel[item.PlatformTier];

    collection.save(item);
})

var collection = db.getSiblingDB("ClientPlatform").AccountIpAuthentication
collection.find({Status: { $type: 16 }}).forEach(function(item){

    item.Status = status[item.Status];

    collection.save(item);
})

